package com.alipay.app.groupmeal.standard.ui.b.util;

import android.content.Context;

import com.alipay.app.groupmeal.standard.http.RetrofitHelper;
import com.alipay.app.groupmeal.standard.http.bean.resp.Result;
import com.alipay.app.groupmeal.standard.offline.bean.FkBean;
import com.alipay.app.groupmeal.standard.offline.bean.SbruanDinnerBean;

import java.util.List;

import io.reactivex.rxjava3.internal.observers.BlockingBaseObserver;

public class SysHttpUtil {
    private Context context;


    public SysHttpUtil(Context activity) {
        this.context = activity;
    }

    /**
     * 获取订餐餐次
     *
     * @param observer
     */
    public void downMainpSbruanDinner(BlockingBaseObserver<Result<List<SbruanDinnerBean>>> observer) {
        RetrofitHelper.getInstance().downMainpSbruanDinner()
                .compose(RxHelper.rxSchedulerHelper())
                .subscribeWith(observer);
    }

    /**
     * 下载FK表
     *
     * @param observer
     */
    public void downFk(BlockingBaseObserver<Result<List<FkBean>>> observer) {
        RetrofitHelper.getInstance().downFk("2020-01-01 00:00:00")
                .compose(RxHelper.rxSchedulerHelper())
                .subscribeWith(observer);
    }


}
